home *** CD-ROM | disk | FTP | other *** search
Wrap
#!/usr/bin/env python #Developed by Alberto Milone (aka tseliot) import sys import commands import string import os, popen2, fcntl, fcntl, select from os.path import isfile import shutil import interfaceclasses import classes #instun/classes.py import main#instun/main.py import idcardlist ver = '0.9.3'#SET ENVY VERSION HERE legacyoses = ['dapper', 'etch'] debianos = ['etch'] '''DE\BLACKLIST FGLRX OR NVIDIA''' def deblacklist():#Remove any driver from the blacklist blist = classes.Chooselist() blist.driver = '' blist.blacklist() def blacklistnv():#Blacklist the Nvidia driver blist = classes.Chooselist() blist.driver = 'nv' blist.blacklist() def blacklistati():#Blacklist the Ati driver blist = classes.Chooselist() blist.driver = 'fglrx' blist.blacklist() ''' FUNCTIONS TO USE TO ENABLE\DISABLE COMPOSITE ''' def removecomposite():#removes any trace of the Composite Extension compositext = classes.Composite() compositext.file = '/etc/X11/xorg.conf' compositext.operate() def enablecomposite(): composite = classes.Compositechoice() composite.file = '/etc/X11/xorg.conf' composite.operation = 'Enable' composite.choosecomposite() def disablecomposite(): composite = classes.Compositechoice() composite.file = '/etc/X11/xorg.conf' composite.operation = 'Disable' composite.choosecomposite() ''' FUNCTIONS TO USE TO ENABLE\DISABLE AIGLX ''' def removeaiglx():#removes any trace of AIGLX aiglxtext = classes.Aiglx() aiglxtext.file = '/etc/X11/xorg.conf' aiglxtext.operate() def enableaiglx(): aiglx = classes.Aiglxchoice() aiglx.file = '/etc/X11/xorg.conf' aiglx.operation = 'on' aiglx.chooseaiglx() def disableaiglx(): aiglx = classes.Aiglxchoice() aiglx.file = '/etc/X11/xorg.conf' aiglx.operation = 'off' aiglx.chooseaiglx() '''NVIDIA INSTALLATION SEQUENCE''' '''PART 2: THE REAL INSTALLATION SEQUENCE''' def nvidiainstall2(): task = classes.Specsdetect()#instantiate the class task.init()#initialise empty "details" task.cards = idcardlist.nvnewcards()#set the id lists task.middlecards = idcardlist.nvmidcards() task.legacycards = idcardlist.nvoldcards() task.details['cardbrand'] = 'nvidia' task.codename()#os name task.architecture()#arch task.systemcheck()#system/arch compatibility task.drivertype()#latest, middle, oldest driver task.nvreleasenum()#(e.g. '1.0-9746') task.nvpkg()#pkg1 task.nvvarsum()#md5 ##main.dm_stop()#shut down the Xserver main.blkresmanager()#restricted drivers manager main.dependencies()#dependencies for ATI and Nvidia installers main.remove_nvidia_pkg()#remove previous nvidia packages main.remove_ati_pkg()#remove previous ati packages main.remove_debsrc() task.nvpkgname()#the name of the Nvidia installer task.nvftpfolder() task.nvaddress()#http link to the installer #if task.details['drvtype'] != 'oldest':#TEMPORARY FIX FOR THE LEGACY DRIVER task.getdriver() #main.deldriverfolder() #main.driverextract() task.newkernelcontrol() task.strippedver() task.changelog() task.control() task.rules() task.upstream() task.nvidiapkgmake() task.nvpkginstall1()#MOD task.nvrmdeb() task.nvkmod() task.nvpkginstall2()#MOD main.remove_deb() main.nvremovechanges() task.buildclean() task.nviconadd() task.xorgbackup() task.restoregcc() main.depmodules() #if task.details['drvtype'] != 'oldest': if task.details['osname'] not in debianos: blacklistnv() #else: deblacklist() a = main.xorgset() if a == 'y': task.nvxorgset() main.xserverstart()#if the Xserver is restarted the program will exit print 'ENVY: Operation Completed' mainmenu() '''PART 1: MAKE SURE THE COMPUTER HAS AN NVIDIA CARD''' def nvidiainstall(): compatible = classes.Compatibcheck() compatible.brandname = 'Nvidia' compat = compatible.check()#COMPATIBILITY CHECK if compat != 'error': nvidiainstall2()#CONTINUE THE INSTALLATION else: mainmenu() '''NVIDIA INSTALLATION SEQUENCE''' '''PART 2: THE REAL INSTALLATION SEQUENCE''' def nvidiainstall2g(): task = classes.Specsdetect()#instantiate the class task.init()#initialise empty "details" task.cards = idcardlist.nvnewcards()#set the id lists task.middlecards = idcardlist.nvmidcards() task.legacycards = idcardlist.nvoldcards() task.details['cardbrand'] = 'nvidia' task.codename()#os name task.architecture()#arch task.systemcheck()#system/arch compatibility task.drivertype()#latest, middle, oldest driver task.nvreleasenum()#(e.g. '1.0-9746') task.nvpkg()#pkg1 task.nvvarsum()#md5 ##main.dm_stop()#shut down the Xserver main.blkresmanager()#restricted drivers manager main.dependencies()#dependencies for ATI and Nvidia installers main.remove_nvidia_pkg()#remove previous nvidia packages main.remove_ati_pkg()#remove previous ati packages main.remove_debsrc() task.nvpkgname()#the name of the Nvidia installer task.nvftpfolder() task.nvaddress()#http link to the installer #if task.details['drvtype'] != 'oldest':#TEMPORARY FIX FOR THE LEGACY DRIVER task.getdriver() #main.deldriverfolder() #main.driverextract() task.newkernelcontrol() task.strippedver() task.changelog() task.control() task.rules() task.upstream() task.nvidiapkgmake() task.nvpkginstall1()#MOD task.nvrmdeb() task.nvkmod() task.nvpkginstall2()#MOD main.remove_deb() main.nvremovechanges() task.buildclean() task.nviconadd() task.xorgbackup() task.restoregcc() main.depmodules() if task.details['osname'] not in debianos: blacklistnv() #else: deblacklist() #a = main.xorgset() #if a == 'y': # task.nvxorgset() #main.xserverstart()#if the Xserver is restarted the program will exit os.system('sleep 3') print 'ENVY: Operation Completed' #mainmenu() def nvidiainstallg(): compatible = classes.Compatibcheck() compatible.brandname = 'Nvidia' compat = compatible.check()#COMPATIBILITY CHECK if compat != 'error': nvidiainstall2g()#CONTINUE THE INSTALLATION #else: # mainmenu() '''NVIDIA UNINSTALLATION SEQUENCE''' '''PART 2: THE REAL UNINSTALLATION SEQUENCE''' def nvidiauninstall2g(): task = classes.Specsdetect()#instantiate the class task.init() task.nviconrm() main.remove_nvidia_pkg()#remove previous nvidia packages main.restoremesa() task.codename() if task.details['osname'] not in debianos: deblacklist() os.system('sleep 3') print 'ENVY: Operation Completed' '''PART 1: MAKE SURE THE COMPUTER HAS AN NVIDIA CARD''' def nvidiauninstallg(): compatible = classes.Compatibcheck() compatible.brandname = 'Nvidia' #compat = compatible.check()#COMPATIBILITY CHECK #if compat != 'error': nvidiauninstall2g()#CONTINUE THE INSTALLATION #else: # mainmenu() '''NVIDIA UNINSTALLATION SEQUENCE''' '''PART 2: THE REAL UNINSTALLATION SEQUENCE''' def nvidiauninstall2(): main.remove_deb()#Just in case task = classes.Specsdetect()#instantiate the class task.init()#initialise empty "details" #task.cards = idcardlist.nvnewcards()#set the id lists #task.middlecards = idcardlist.nvmidcards() #task.legacycards = idcardlist.nvoldcards() task.details['cardbrand'] = 'nvidia' task.codename()#os name task.architecture()#arch task.systemcheck()#system/arch compatibility task.nviconrm() main.remove_nvidia_pkg()#remove previous nvidia packages main.remove_ati_pkg()#remove previous ati packages main.remove_debsrc() main.restoremesa() if task.details['osname'] not in debianos: deblacklist() #task.nvxorgset() #main.xserverstart()#if the Xserver is restarted the program will exit print 'ENVY: Operation Completed' mainmenu() '''PART 1: MAKE SURE THE COMPUTER HAS AN NVIDIA CARD''' def nvidiauninstall(): compatible = classes.Compatibcheck() compatible.brandname = 'Nvidia' #compat = compatible.check()#COMPATIBILITY CHECK #if compat != 'error': nvidiauninstall2()#CONTINUE THE INSTALLATION #else: # mainmenu() def maninstall2(): task = classes.Specsdetect()#instantiate the class task.init()#initialise empty "details" #task.cards = idcardlist.nvnewcards()#set the id lists #task.middlecards = idcardlist.nvmidcards() #task.legacycards = idcardlist.nvoldcards() task.codename()#os name task.architecture()#arch task.systemcheck()#system/arch compatibility #task.drivertype()#latest, middle, oldest driver task.manualdetails()#LET YOU CHOOSE THE CARD AND DRIVER main.blkresmanager()#restricted drivers manager if task.details['cardbrand'] == 'nvidia': task.nvreleasenum()#md5 task.nvpkg()#pkg1 task.nvvarsum()#md5 ##main.dm_stop()#shut down the Xserver main.dependencies()#dependencies for ATI and Nvidia installers main.remove_nvidia_pkg()#remove previous nvidia packages main.remove_ati_pkg()#remove previous ati packages main.remove_debsrc() task.nvpkgname()#the name of the Nvidia installer task.nvftpfolder() task.nvaddress()#http link to the installer #if task.details['drvtype'] != 'oldest':#TEMPORARY FIX FOR THE LEGACY DRIVER task.getdriver() #main.deldriverfolder() #main.driverextract() task.newkernelcontrol() task.strippedver() task.changelog() task.control() task.rules() task.upstream() task.nvidiapkgmake() task.nvpkginstall1()#MOD task.nvrmdeb() task.nvkmod() task.nvpkginstall2()#MOD main.remove_deb() main.nvremovechanges() task.buildclean() task.nviconadd() task.geforcegocheck()#only for geforce go and manual installation task.xorgbackup() task.restoregcc() main.depmodules() if task.details['osname'] not in debianos: deblacklist() #else: deblacklist() a = main.xorgset() if a == 'y': task.nvxorgset() main.xserverstart()#if the Xserver is restarted the program will exit elif task.details['cardbrand'] == 'ati': if task.details['osname'] not in legacyoses and task.details['drvtype'] == 'oldest': print 'ENVY ERROR: ATI\'s legacy driver does not support your operative system' else: main.remove_deb()#Just in case #task = classes.Specsdetect()#instantiate the class ##task.init()#initialise empty "details" #task.cards = idcardlist.atinewcards()#set the id lists #task.middlecards = idcardlist.atimidcards() #task.legacycards = idcardlist.atioldcards() #task.codename()#os name #task.architecture()#arch #task.systemcheck()#system/arch compatibility #task.drivertype()#latest, middle, oldest driver task.atireleasenum()#(e.g. '8.28.8') #task.nvpkg()#pkg1 task.ativarsum()#md5 #main.dm_stop()#shut down the Xserver main.dependencies()#dependencies for ATI and Nvidia installers main.remove_ati_pkg()#remove previous nvidia packages main.remove_nvidia_pkg() main.remove_debsrc() task.atipkgname()#the name of the ATI installer #task.nvftpfolder() task.atiaddress()#http link to the installer task.getdriver() #main.deldriverfolder() #main.driverextract() task.newkernelcontrol() task.atirmdeb()#Remove any old fglrx deb from /usr/src/ task.atipkgmake()#makepackages task.atipkginstall() task.atikmod() main.remove_deb()#Just in case task.xorgbackup() task.restoregcc() main.depmodules() if task.details['osname'] not in debianos: blacklistati() main.atiremovechanges() a = main.xorgset() if a == 'y': task.atixorgset() main.pcrestart()#the ATI driver needs a reboot #main.xserverstart()#if the Xserver is restarted the program will exit #os.system('sleep 3') print 'ENVY: Operation Completed' mainmenu() '''PART 1: MANUAL INSTALLATION''' def maninstall(): #compatible = classes.Compatibcheck() #compatible.brandname = 'Nvidia' #compat = compatible.check()#COMPATIBILITY CHECK #if compat != 'error': maninstall2()#CONTINUE THE INSTALLATION #else: # mainmenu() #def maninstall4(brand, drv): # task = classes.Specsdetect()#instantiate the class # task.init()#initialise empty "details" # task.details['cardbrand'] = '\'' + brand + '\'' # task.details['drvtype'] = '\'' + drv + '\'' # print task.details['cardbrand'] # print task.details['drvtype'] def maninstall3(brand, drv): #print brand #print drv task = classes.Specsdetect()#instantiate the class task.init()#initialise empty "details" #task.cards = idcardlist.nvnewcards()#set the id lists #task.middlecards = idcardlist.nvmidcards() #task.legacycards = idcardlist.nvoldcards() task.details['cardbrand'] = brand#'\'' + brand + '\'' task.details['drvtype'] = drv#'\'' + drv + '\'' #print task.details['cardbrand'] #print task.details['drvtype'] task.codename()#os name task.architecture()#arch task.systemcheck()#system/arch compatibility #task.details['cardbrand'] = '\'' + brand + '\'' #task.details['drvtype'] = '\'' + drv + '\'' #task.drivertype()#latest, middle, oldest driver #task.manualdetails()#LET YOU CHOOSE THE CARD AND DRIVER main.blkresmanager()#restricted drivers manager if task.details['cardbrand'] == 'nvidia': task.nvreleasenum()#md5 task.nvpkg()#pkg1 task.nvvarsum()#md5 ##main.dm_stop()#shut down the Xserver main.dependencies()#dependencies for ATI and Nvidia installers main.remove_nvidia_pkg()#remove previous nvidia packages main.remove_ati_pkg()#remove previous ati packages main.remove_debsrc() task.nvpkgname()#the name of the Nvidia installer task.nvftpfolder() task.nvaddress()#http link to the installer #if task.details['drvtype'] != 'oldest':#TEMPORARY FIX FOR THE LEGACY DRIVER task.getdriver() #main.deldriverfolder() #main.driverextract() task.newkernelcontrol() task.strippedver() task.changelog() task.control() task.rules() task.upstream() task.nvidiapkgmake() task.nvpkginstall1()#MOD task.nvrmdeb() task.nvkmod() task.nvpkginstall2()#MOD main.remove_deb() main.nvremovechanges() task.buildclean() task.nviconadd() task.geforcegocheck()#only for geforce go and manual installation task.xorgbackup() task.restoregcc() main.depmodules() if task.details['osname'] not in debianos: blacklistnv() #else: deblacklist() #a = main.xorgset() #if a == 'y': # task.nvxorgset() #main.xserverstart()#if the Xserver is restarted the program will exit os.system('sleep 3') print 'ENVY: Operation Completed' #mainmenu() #blacklistnv() #task.nvxorgset()#FARE POPUP!!! #main.xserverstart()#if the Xserver is restarted the program will exit##FARE POPUP!!! elif task.details['cardbrand'] == 'ati': if task.details['osname'] not in legacyoses and task.details['drvtype'] == 'oldest': print 'ENVY ERROR: ATI\'s legacy driver does not support your operative system' else: main.remove_deb()#Just in case #task = classes.Specsdetect()#instantiate the class ##task.init()#initialise empty "details" #task.cards = idcardlist.atinewcards()#set the id lists #task.middlecards = idcardlist.atimidcards() #task.legacycards = idcardlist.atioldcards() #task.codename()#os name #task.architecture()#arch #task.systemcheck()#system/arch compatibility #task.drivertype()#latest, middle, oldest driver task.atireleasenum()#(e.g. '8.28.8') #task.nvpkg()#pkg1 task.ativarsum()#md5 #main.dm_stop()#shut down the Xserver main.dependencies()#dependencies for ATI and Nvidia installers main.remove_ati_pkg()#remove previous nvidia packages main.remove_nvidia_pkg() main.remove_debsrc() task.atipkgname()#the name of the ATI installer #task.nvftpfolder() task.atiaddress()#http link to the installer task.getdriver() #main.deldriverfolder() #main.driverextract() task.newkernelcontrol() task.atirmdeb()#Remove any old fglrx deb from /usr/src/ task.atipkgmake()#makepackages task.atipkginstall() task.atikmod() main.remove_deb()#Just in case task.xorgbackup() task.restoregcc() main.depmodules() if task.details['osname'] not in debianos: blacklistati() main.atiremovechanges() os.system('sleep 3') print 'ENVY: Operation Completed' #task.atixorgset() ##main.xserverstart()#if the Xserver is restarted the program will exit#POPUP ##main.pcrestart()#the ATI driver needs a reboot#POPUP else: print 'Something wrong with the if' ##print 'Operation Completed'POPUP '''ATI INSTALLATION SEQUENCE''' '''PART 2: THE REAL INSTALLATION SEQUENCE''' def atiinstall2(): main.remove_deb()#Just in case task = classes.Specsdetect()#instantiate the class task.init()#initialise empty "details" task.cards = idcardlist.atinewcards()#set the id lists task.middlecards = idcardlist.atimidcards() task.legacycards = idcardlist.atioldcards() task.details['cardbrand'] = 'ati' task.codename()#os name task.architecture()#arch task.systemcheck()#system/arch compatibility main.blkresmanager()#restricted drivers manager task.drivertype()#latest, middle, oldest driver if task.details['osname'] not in legacyoses and task.details['drvtype'] == 'oldest': print 'ENVY ERROR: ATI\'s legacy driver does not support your operative system' else: task.atireleasenum()#(e.g. '8.28.8') #task.nvpkg()#pkg1 task.ativarsum()#md5 #main.dm_stop()#shut down the Xserver main.dependencies()#dependencies for ATI and Nvidia installers main.remove_nvidia_pkg()#remove previous nvidia packages main.remove_ati_pkg()#remove previous ati packages main.remove_debsrc() task.atipkgname()#the name of the ATI installer #task.nvftpfolder() task.atiaddress()#http link to the installer task.getdriver() #main.deldriverfolder() #main.driverextract() task.newkernelcontrol() task.atirmdeb()#Remove any old fglrx deb from /usr/src/ task.atipkgmake()#makepackages task.atipkginstall() task.atikmod() main.remove_deb()#Just in case task.xorgbackup() task.restoregcc() main.depmodules()#make sure the module is there if task.details['osname'] not in debianos: blacklistati() main.atiremovechanges() task.atixorgset() #main.xserverstart()#if the Xserver is restarted the program will exit main.pcrestart()#the ATI driver needs a reboot print 'ENVY: Operation Completed' mainmenu() '''PART 1: MAKE SURE THE COMPUTER HAS AN ATI CARD''' def atiinstall(): compatible = classes.Compatibcheck() compatible.brandname = 'ATI' compat = compatible.check()#COMPATIBILITY CHECK if compat != 'error': atiinstall2()#CONTINUE THE INSTALLATION #else: # mainmenu() '''ATI INSTALLATION SEQUENCE''' '''ATI INSTALLATION SEQUENCE''' '''PART 2: THE REAL INSTALLATION SEQUENCE''' def atiinstall2g(): main.remove_deb()#Just in case task = classes.Specsdetect()#instantiate the class task.init()#initialise empty "details" task.cards = idcardlist.atinewcards()#set the id lists task.middlecards = idcardlist.atimidcards() task.legacycards = idcardlist.atioldcards() task.details['cardbrand'] = 'ati' task.codename()#os name task.architecture()#arch task.systemcheck()#system/arch compatibility main.blkresmanager()#restricted drivers manager task.drivertype()#latest, middle, oldest driver if task.details['osname'] not in legacyoses and task.details['drvtype'] == 'oldest': print 'ENVY ERROR: ATI\'s legacy driver does not support your operative system' else: task.atireleasenum()#(e.g. '8.28.8') #task.nvpkg()#pkg1 task.ativarsum()#md5 #main.dm_stop()#shut down the Xserver main.dependencies()#dependencies for ATI and Nvidia installers main.remove_ati_pkg()#remove previous ati packages main.remove_nvidia_pkg()#remove previous nvidia packages main.remove_debsrc() task.atipkgname()#the name of the ATI installer #task.nvftpfolder() task.atiaddress()#http link to the installer task.getdriver() #main.deldriverfolder() #main.driverextract() task.newkernelcontrol() task.atirmdeb()#Remove any old fglrx deb from /usr/src/ task.atipkgmake()#makepackages task.atipkginstall() task.atikmod() main.remove_deb()#Just in case task.xorgbackup() task.restoregcc() main.depmodules()#make sure the module is there if task.details['osname'] not in debianos: blacklistati() main.atiremovechanges() os.system('sleep 3') print 'ENVY: Operation Completed' #task.atixorgset() #main.xserverstart()#if the Xserver is restarted the program will exit #main.pcrestart()#the ATI driver needs a reboot #print 'ENVY: Operation Completed' #mainmenu() def atiinstallg(): compatible = classes.Compatibcheck() compatible.brandname = 'ATI' compat = compatible.check()#COMPATIBILITY CHECK if compat != 'error': atiinstall2g()#CONTINUE THE INSTALLATION #else: # mainmenu() '''ATI UNINSTALLATION SEQUENCE''' '''PART 2: THE REAL UNINSTALLATION SEQUENCE''' def atiuninstall2(): main.remove_deb()#Just in case task = classes.Specsdetect()#instantiate the class task.init()#initialise empty "details" main.remove_ati_pkg()#remove previous ati packages task.atirmdeb()#Remove any old fglrx deb from /usr/src/ task.codename()#os name if task.details['osname'] not in debianos: deblacklist() main.restoremesa() os.system('sleep 3') print 'ENVY: Operation Completed' mainmenu() '''PART 1: MAKE SURE THE COMPUTER HAS AN ATI CARD''' def atiuninstall(): compatible = classes.Compatibcheck() compatible.brandname = 'ATI' #compat = compatible.check()#COMPATIBILITY CHECK #if compat != 'error': atiuninstall2()#CONTINUE THE INSTALLATION #else: # mainmenu() '''ATI UNINSTALLATION SEQUENCE''' '''PART 2: THE REAL UNINSTALLATION SEQUENCE''' def atiuninstall2g(): main.remove_deb()#Just in case task = classes.Specsdetect()#instantiate the class task.init()#initialise empty "details" main.remove_ati_pkg()#remove previous ati packages task.atirmdeb()#Remove any old fglrx deb from /usr/src/ task.codename()#os name if task.details['osname'] not in debianos: deblacklist() main.restoremesa() os.system('sleep 3') print 'ENVY: Operation Completed' #mainmenu() '''PART 1: MAKE SURE THE COMPUTER HAS AN ATI CARD''' def atiuninstallg(): compatible = classes.Compatibcheck() compatible.brandname = 'ATI' #compat = compatible.check()#COMPATIBILITY CHECK #if compat != 'error': atiuninstall2g()#CONTINUE THE INSTALLATION #else: # mainmenu() '''NVIDIA UNINSTALLATION SEQUENCE''' '''PART 2: THE REAL UNINSTALLATION SEQUENCE''' def nvidiaclean2(): main.remove_deb()#Just in case task = classes.Specsdetect()#instantiate the class task.init()#initialise empty "details" #task.cards = idcardlist.nvnewcards()#set the id lists #task.middlecards = idcardlist.nvmidcards() #task.legacycards = idcardlist.nvoldcards() task.details['cardbrand'] = 'nvidia' task.details['drvtype'] = 'latest' task.codename()#os name task.architecture()#arch task.systemcheck()#system/arch compatibility ##task.drivertype()#latest, middle, oldest driver task.details['drvtype'] = 'latest'#set the driver to latest task.nvreleasenum()#(e.g. '1.0-9746') task.nvpkg()#pkg1 task.nvvarsum()#md5 main.dm_stop()#shut down the Xserver main.dependencies()#dependencies for ATI and Nvidia installers main.remove_nvidia_pkg()#remove previous nvidia packages main.remove_debsrc() task.nvpkgname()#the name of the Nvidia installer task.nvftpfolder() task.nvaddress()#http link to the installer task.getdriver() #main.deldriverfolder() #main.driverextract() #task.nvkernelcontrol() #task.xorgbackup() #task.restoregcc() task.nvuninstalling() if task.details['osname'] not in debianos: deblacklist() #task.nvxorgset() #main.xserverstart()#if the Xserver is restarted the program will exit print 'ENVY: Operation Completed' mainmenu() '''PART 1: MAKE SURE THE COMPUTER HAS AN NVIDIA CARD''' def nvidiaclean(): compatible = classes.Compatibcheck() compatible.brandname = 'Nvidia' #compat = compatible.check()#COMPATIBILITY CHECK NOT NECESSARY #if compat != 'error': nvidiaclean2()#CONTINUE THE INSTALLATION #else: # mainmenu() '''RESTART THE XSERVER''' def xserverstart(): os.system('sudo /etc/init.d/gdm restart') os.system('sudo /etc/init.d/kdm restart') ''' ASK FOR CONFIRMATION OF USER'S CHOICE ''' def nvinstconfirm():#Install the Nvidia driver confirmation = interfaceclasses.Interface() confirmation.operation = 'install' confirmation.brand = 'Nvidia driver' confirmation.gotoop = nvidiainstall() confirmation.confirm() def nvuninstconfirm():#Uninstall the Nvidia driver confirmation = interfaceclasses.Interface() confirmation.operation = 'uninstall' confirmation.brand = 'Nvidia driver' confirmation.gotoop = nvidiauninstall() confirmation.confirm() def atiinstconfirm():#Install the ATI driver confirmation = interfaceclasses.Interface() confirmation.operation = 'install' confirmation.brand = 'Ati driver' confirmation.gotoop = atiinstall() confirmation.confirm() def maninstconfirm():#Install the driver Manually confirmation = interfaceclasses.Interface() confirmation.operation = 'install' confirmation.brand = 'driver manually' confirmation.gotoop = maninstall() confirmation.confirm() def atiuninstconfirm():#Uninstall the ATI driver confirmation = interfaceclasses.Interface() confirmation.operation = 'uninstall' confirmation.brand = 'Ati driver' confirmation.gotoop = atiuninstall() confirmation.confirm() def nvcleanconfirm():#Clean the NVIDIA driver confirmation = interfaceclasses.Interface() confirmation.operation = 'clean' confirmation.brand = 'the NVIDIA driver'#RIDEFINIRE QUESTA STRINGA!!! confirmation.gotoop = nvidiaclean()#RIDEFINIRE LA FUNZIONE!!! confirmation.confirm() def xorgreset():#Restart the Xserver confirmation = interfaceclasses.Interface() confirmation.operation = 'restart' confirmation.brand = 'Xserver' confirmation.gotoop = main.xserverstart()#nvidiainstall() confirmation.confirm() '''INTERFACE OBJECTS''' '''Welcome''' def welcomemenu(): menu0 = interfaceclasses.Interface() #menu0.init() menu0.linetxt = ['-', '', ' Welcome to Envy ' + ver, ' ', 'Developed by Alberto Milone (aka tseliot)', '', '-'] menu0.page() '''Main Menu''' def mainmenu(): menu1 = interfaceclasses.Interface() menu1.linetxt = ['', 'Envy Menu ver.' + ver, '', '1 - Install the NVIDIA driver', '', '2 - Uninstall the NVIDIA driver', '', '3 - Install the ATI driver', '', '4 - Uninstall the ATI driver', '','5 - Install the ATI/NVIDIA driver Manually', '', '6 - Clean the Installation of any Nvidia driver', '', '7 - Restart the Xserver', '', '8 - Exit', '', 'NOTE: IF THE SCREEN TURNS BLACK, PLEASE TYPE ALT+F1', ''] while 1: menu1.page() reply = raw_input('Please select one of the activities displayed above and press ENTER:\n\n').strip() if reply == '1': menu1.operation = 'nvinstall' #return operation break elif reply == '2': menu1.operation = 'nvuninstall' #return operation break elif reply == '3': menu1.operation = 'atiinstall' #return operation break elif reply == '4': menu1.operation = 'atiuninstall' #return operation break elif reply == '5': menu1.operation = 'maninstall' #return operation break elif reply == '6': menu1.operation = 'nvidiaclean' #return operation break elif reply == '7': menu1.operation = 'xorgrestart' #return operation break elif reply == '8': sys.exit() break menu1.process()